# 获取当前CMakeLists.txt文件所在目录的完整路径
set(CURRENT_CMAKELIST_DIR "${CMAKE_CURRENT_SOURCE_DIR}")

# 获取当前目录的名称
get_filename_component(CURRENT_DIR_NAME ${CURRENT_CMAKELIST_DIR} NAME)

# 输出目录名称
message(STATUS "Current CMakeLists directory name: ${CURRENT_DIR_NAME}")

set(TARGET ${CURRENT_DIR_NAME})
#dubug -g 调试 GBK 中文
# set (CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -g -fexec-charset=GBK")
# 设置源代码文件的编码为UTF-8
set(CMAKE_CHARSET "UTF-8")
 
# 设置编译器选项以支持UTF-8
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -finput-charset=UTF-8")

file(GLOB SOURCES_FILES 
	"./*.cpp")

file(GLOB HEADER_FILES 
	"./*.h")

# 添加可执行文件，注意添加WIN32，否则有一个控制台黑框
add_executable(${TARGET} ${SOURCES_FILES} ${HEADER_FILES})
# add_dependencies(${TAGET} yu_math)
include(${SRC_ROOT_DIR}/cmake/FindService.cmake)

message("apps: Main 执行完成！")
set_target_properties(${TARGET} PROPERTIES FOLDER "apps") #将此工程分类到文件夹中
# 为 Debug 和 Release 配置的库文件设置后缀
set_target_properties(${TARGET} PROPERTIES
  DEBUG_POSTFIX "_d"
  RELEASE_POSTFIX ""
)
